/* dwifiUDP.h
   For use with the Dexter Industries dWIFI
   The dWIFI can be found here:  http://dexterindustries.com/wifi/ */

#include "string.h"
#include "ctype.h"
#include "SoftwareSerial.h"
#include "pins_arduino.h"
#include "math.h"
#include "Arduino.h"

#ifndef dwifiudp_h
#define dwifiudp_h

class dwifiUDP
{
	public: 
                String ssid;
                String ind;
                String key;
                boolean flag;
                String output;
                long baudrates[5];
                char buffer[500];
                String commandStr;
                int bytewifi;
                void init();
		String getstr();                
		void CTS_start();
		void CTS_stop();
		boolean RTS_check();
		void writeStr(String);
                void writeesc(char, String, char);
                void Receive(boolean);
                void readall();
		void clear_read_buffer();
		boolean set_baud(long);
		int inString(char*, char);
		boolean verbose_on(boolean);
		boolean echo_on(boolean);
		long scan_baud();
		int hex2int(char);
		boolean soft_flow_control(boolean);
		boolean hard_flow_control(boolean);
		boolean infra_mode(boolean);
		boolean set_network_config(unsigned int);
		boolean keep_alive(unsigned int);
		boolean set_transmit_power(int);
                void disassociate();
		boolean wifi_auth_mode(int);
		void network_stat();
                boolean DHCP_enable(boolean);
                void associate_with_network(boolean);
		void setWep();
		void setWpa();
		String dns_lookup(String);
                int server_start(unsigned int);
		int client_connect(String, unsigned int);
		void udp_client_write(String, int);
		String udp_read(int);
		void udp_server_write(String, int, String, unsigned int);
		boolean cid_disconnect(int);
		void cid_check();
};

#endif
